package qeug.shsh.webService;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;

import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;

/**
 * @projectName: qeug-cosmic-root-project
 * @package: qeug.shsh.webService
 * @className: WebServiceUtil
 * @author: wenyx
 * @description: TODO 调用webService接口生
 * @date: 2023/10/23 9:40
 * @version: 1.0
 */
public class WebServiceUtil {

    /**
     *
     * @param method 调用方法
     * @param url BPM接口url
     * @param strProcessName 流程名
     * @param strLoginName 发起人工号
     * @param json 表单json
     * @return
     * @throws ServiceException
     * @throws RemoteException
     */
    public static String invokeBPM(String method,String url,String strProcessName,String strLoginName,String json) throws ServiceException, MalformedURLException, RemoteException {
        NNFSoap_PortType nnfSoap = new NNFLocator().getNNFSoap(new URL(url));
        String s = nnfSoap.send_New(strProcessName, 0, strLoginName, json);
        return s;
    }


    /**
     *
     * @param url BPM接口url
     * @param xml 调用参数
     * @return
     * @throws ServiceException
     * @throws RemoteException
     */
    public static String invokeG6Pay(String url,String xml) throws RemoteException, ServiceException, MalformedURLException {
        TxServiceGateway_PortType portType  = new TxServiceGateway_ServiceLocator().getTxServiceGatewayPort(new URL(url));
        String s = portType.send(xml);
        return s;
    }

}
